/** Defines a class to play additive waves.
* @file AdditiveInstrument.h
*/
#pragma once
#include "instrument.h"

#include "AdditiveSynth.h"
#include "AmpADSR.h"

/** An instrument that plays a sine wave and seven of its harmonics at given amplitudes.
*/
class CAdditiveInstrument :
	public CInstrument
{
public:
	CAdditiveInstrument(void);
	virtual ~CAdditiveInstrument(void);

	virtual void Start();
    virtual bool Generate();
    virtual void SetNote(CNote *aNote);
    
	CAdditiveSynth *GetSynth() { return &mSynth; }

	void SetDuration(double aDuration) { mADSR.SetDuration( aDuration ); }
	void SetFreq(double aFreq ) {}

private:
	CAdditiveSynth mSynth;
	CAmpADSR mADSR;
	double mTime;
};